/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.flexengine.config;

import com.flexengine.server.FlexEngineServer;
import com.flexengine.sound.SoundManager;
import com.flexengine.utils.ResourceManager;
import com.flexengine.language.LanguageManager;
import com.flexengine.view.RendererType;
import java.awt.DisplayMode;
import java.io.Serializable;

/**
 * @author Luann R. Athayde
 * @version 1.0
 * @since 1.0
 */
public class Configuration implements Serializable {

    private FlexDisplayMode resolution;
    private RendererType renderType;
    private boolean fullScreen;
    private boolean antialising;
    private boolean textAntialising;
    private String language;
    private String resourcesPath;
    private boolean sound;
    private float generalVolume;
    private float musicVolume;
    private float effectVolume;
    private int channels;
    private String host;
    private int port;
    private long maxConnections;

    public Configuration(FlexDisplayMode resolution, RendererType renderType, boolean fullScreen, boolean antialising, boolean textAntialising, String language, String resourcesPath, boolean sound, float generalVolume, float musicVolume, float effectVolume, int channels, String host, int port, long maxConnections) {
        this.resolution = resolution;
        this.renderType = renderType;
        this.fullScreen = fullScreen;
        this.antialising = antialising;
        this.textAntialising = textAntialising;
        this.language = language;
        this.resourcesPath = resourcesPath;
        this.sound = sound;
        this.generalVolume = generalVolume;
        this.musicVolume = musicVolume;
        this.effectVolume = effectVolume;
        this.channels = channels;
        this.host = host;
        this.port = port;
        this.maxConnections = maxConnections;
    }

    public Configuration() {
        this(
                new FlexDisplayMode(1280, 720, DisplayMode.BIT_DEPTH_MULTI, 60),
                RendererType.RENDERER_DEFAULT,
                false,
                false, true,
                LanguageManager.getLanguage().getName(),
                ResourceManager.DEFAULT_PATH,
                SoundManager.getInstance().isEnable(),
                100f, 100f, 100f, 32,
                "localhost",
                FlexEngineServer.DEFAULT_PORT,
                FlexEngineServer.MAX_USERS_CONNECTION);
    }

    public FlexDisplayMode getResolution() {
        return resolution;
    }

    public void setResolution(FlexDisplayMode resolution) {
        this.resolution = resolution;
    }

    public RendererType getRenderer() {
        return renderType;
    }

    public void setRenderer(RendererType renderer) {
        this.renderType = renderer;
    }

    public boolean isFullScreen() {
        return fullScreen;
    }

    public void setFullScreen(boolean fullScreen) {
        this.fullScreen = fullScreen;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getResourcesPath() {
        return resourcesPath;
    }

    public void setResourcesPath(String resourcesPath) {
        this.resourcesPath = resourcesPath;
    }

    public boolean isSound() {
        return sound;
    }

    public void setSound(boolean sound) {
        this.sound = sound;
    }

    public float getGeneralVolume() {
        return generalVolume;
    }

    public void setGeneralVolume(float generalVolume) {
        this.generalVolume = generalVolume;
    }

    public float getMusicVolume() {
        return musicVolume;
    }

    public void setMusicVolume(float musicVolume) {
        this.musicVolume = musicVolume;
    }

    public float getEffectVolume() {
        return effectVolume;
    }

    public void setEffectVolume(float effectVolume) {
        this.effectVolume = effectVolume;
    }

    public int getChannels() {
        return channels;
    }

    public void setChannels(int channels) {
        this.channels = channels;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public long getMaxConnections() {
        return maxConnections;
    }

    public void setMaxConnections(long maxConnections) {
        this.maxConnections = maxConnections;
    }

    public boolean isAntialising() {
        return antialising;
    }

    public boolean isTextAntialising() {
        return textAntialising;
    }

    public void setAntialising(boolean antialising) {
        this.antialising = antialising;
    }

    public void setRenderType(RendererType renderType) {
        this.renderType = renderType;
    }

    public void setTextAntialising(boolean textAntialising) {
        this.textAntialising = textAntialising;
    }

    @Override
    public String toString() {
        return "Configuration{" + "resolution=" + resolution + ", renderType=" + renderType + ", fullScreen=" + fullScreen + ", antialising=" + antialising + ", textAntialising=" + textAntialising + ", language=" + language + ", resourcesPath=" + resourcesPath + ", sound=" + sound + ", generalVolume=" + generalVolume + ", musicVolume=" + musicVolume + ", effectVolume=" + effectVolume + ", channels=" + channels + ", host=" + host + ", port=" + port + ", maxConnections=" + maxConnections + '}';
    }

}
